// N1Thread.h: interface for the N1Thread class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_N1THREAD_H__B7D03E44_576A_40A4_B1A7_5D5192B85B51__INCLUDED_)
#define AFX_N1THREAD_H__B7D03E44_576A_40A4_B1A7_5D5192B85B51__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "N1Lib.h"

class N1Object;
class N1Dictionary;

class NEXPORT N1Thread : public N1Object {
protected:
    N1Dictionary*   m_Dictionary;
    static N1UInt32 m_nCount;
#ifdef WINDOWS
    HANDLE          m_hThread;
    N1UInt32        m_nThreadId;
#endif

	N1Thread();

#ifdef WINDOWS
    friend DWORD WINAPI ThreadProc(LPVOID lpParameter);
#endif

public:
	virtual ~N1Thread();

    virtual const char*   description() const;
    virtual const char*   name() const { return "N1Thread"; };

    static N1Thread* currentThread();
    static N1UInt32  currentThreadId();

    static void detachNewThreadSelector(N1Object *selector, N1Object *param);

    static BOOL isMultiThreaded();
    N1Dictionary* threadDictionary();
    //static void sleepUntilDate(NSDate *date);
    static void exit();
    static double threadPriority();
    static BOOL setThreadPriority(double priority);

/*
+ (NSThread *)currentThread;
+ (void)detachNewThreadSelector:(SEL)selector toTarget:(id)target withObject:(id)argument;
+ (BOOL)isMultiThreaded;
- (NSMutableDictionary *)threadDictionary;
+ (void)sleepUntilDate:(NSDate *)date;
+ (void)exit;
+ (double)threadPriority;
+ (BOOL)setThreadPriority:(double)priority;
*/

};

#endif // !defined(AFX_N1THREAD_H__B7D03E44_576A_40A4_B1A7_5D5192B85B51__INCLUDED_)
